package com.ruoyi.business.service;

import org.activiti.engine.repository.Deployment;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;

import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.List;
import java.util.Map;

public interface IProcessService {
    //根据上传的文件进行流程定义部署
    Deployment deploy(String filePath) throws FileNotFoundException;

    //根据流程部署ID找到对应的流程定义信息
    ProcessDefinition getProcessDefinitionByDeploymentId(String deploymentId);

    //根据部署ID查询对应的bpmn文件
    InputStream getBpmnInputStream(String deploymentId);

    //根据流程部署ID获取流程图png
    InputStream getProcessImg(String deploymentId);

    //流程启动
    ProcessInstance startProcessInstance(String definitionKey, String businessKey, Map<String, Object> variables);

    //根据流程实例ID获取当前的任务节点
    Task getTaskByProcessInstanceId(String processInstanceId);

    //给当前任务设置候选人
    void addCandidateUser(Task task, Long userId);

    InputStream getProcessImgByInstanceId(String instanceId);

    //根据流程实例ID删除流程
    void deleteProcessInstance(String instanceId);

    Long getTodoTsaskCount(String definitionKey, String userId);

    List<Task> selectTodoTaskList(String definitionKey, String userId, Integer starNum, Integer pageSize);

    ProcessInstance getProcessInstanceById(String processInstanceId);

    Task getTaskByTaskId(String taskId);

    void claimAndComplete(Task task, String userId, Boolean auditStatus, String comment);
}
